class TerminalBase:
    def common_button(self, button_name):
        return "//button[text()='" + button_name + "']"

    def label_input(self, lable_name):
        return "//label[text()='" + lable_name + "']/following-sibling::input"

    def combobox(self, lable_name):
        return "//label[text()='" + lable_name + "']/following-sibling::div"

    def combobox_detail(self, item):
        return "//div[text()='" + item + "']"

    def displayed_checkbox(self, lable_for):
        return "//label[@for='" + lable_for + "']"

    def hidden_checkbox(self, id):
        return "//input[@id='" + id + "']"

    def alert_message(self):
        return "//div[@data-testid='messageContainer']"

    def alert_close(self):
        return "//button[@class='Toastify__close-button Toastify__close-button--success']"

    def common_close(self):
        return "//h3[text()='Application']/../*[name()='svg']"

    def terminal_name(self, terminal_name, merchant_name):
        return "//td[@data-label='Merchant']/span[text()='" + merchant_name + "']/parent::td//preceding-sibling::td[@data-label='Terminal Name']/span[text()='" + terminal_name + "']"

    def terminal_action(self, terminal_name):
        return "//span[text()='" + terminal_name + "']/parent::td[@data-label='Terminal Name']//following-sibling::td[@data-label='Action']//div[@role='button']"

    def terminal_detail(self, terminal_name):
        return "//span[text()='" + terminal_name + "']/parent::td[@data-label='Terminal Name']//following-sibling::td[@data-label='Action']//a[contains(text(),'Details')]"

    def action_detail(self, terminal_name, acrion_name):
        return "//span[text()='" + terminal_name + "']/parent::td[@data-label='Terminal Name']//following-sibling::td[@data-label='Action']//button[contains(text(),'" + acrion_name + "')]"

    def publish_button(self, app_name, role):
        return "//div[text()='" + app_name + "']/parent::div/parent::div//div[contains(text(),'" + role + "')]/preceding-sibling::button"
